import com.adobe.cairngorm.control.CairngormEventDispatcher;

import mx.events.CloseEvent;
import mx.managers.PopUpManager;

import net.optix.ip.events.RecordTradeMarkEvent;
import net.optix.ip.model.ModelLocator;
import net.optix.ip.vo.TradeMarkVO;

[Bindable]
private var model:ModelLocator	=	ModelLocator.getInstance();

public function init():void
{
	model.bSubmit	=	true;
	model.result	=	"";
 	model.close		=	"no";
}
  			
private function titleWindow_close(evt:CloseEvent):void 
{ 
	model.result	=	"";
 	model.bSubmit	=	true;
  	PopUpManager.removePopUp(this); 
}

private function recordTradeMark():void
{
	model.bSubmit	=	false;
	var vo:TradeMarkVO	=	new TradeMarkVO();
	vo.clientID		=	model.client.clientID;
	vo.tradeMark		=	tradeMark.text;
	vo.excluded			=	excluded.text;
	vo.firstUseDate		=	firstUse.text;
	vo.filed			=	filed.text;
	vo.serialNumber		=	serialNumber.text;
	vo.registered		=	registered.selected?1:0;
	vo.registrationNumber=	registrationNumber.text;
	vo.registrationDate	=	registrationDate.text;
	vo.renewBy			=	renewalBy.text;
	
	var event:RecordTradeMarkEvent	=	new RecordTradeMarkEvent(vo);
	com.adobe.cairngorm.control.CairngormEventDispatcher.getInstance().dispatchEvent(event);
}

